From: Jasper St. Pierre Date: Wed, 15 Oct 2014 05:25:30 +0000 (-0700) Subject: main: Allow loading file-based stylesheets again X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2016 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=48a6e6f3098dccf5b857fd7d436a2ba4dc9ba90c;p=gnome-shell.git main: Allow loading file-based stylesheets again The gnome-classic mode ships a stylesheet on disk, so make sure to load that if if we can't find any file in the resource itself. --- diff --git a/js/ui/main.js b/js/ui/main.js index 149e25a05..2fff9e654 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -227,11 +227,25 @@ function _initializeUI() { }); } +function _getDefaultStylesheet() { + let stylesheet; + + stylesheet = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/' + sessionMode.stylesheetName); + if (stylesheet.query_exists(null)) + return stylesheet; + + stylesheet = Gio.File.new_for_path(global.datadir + '/theme/' + sessionMode.stylesheetName); + if (stylesheet.query_exists(null)) + return stylesheet; + + return null; +} + function _loadDefaultStylesheet() { if (!sessionMode.isPrimary) return; - let stylesheet = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/' + sessionMode.stylesheetName); + let stylesheet = _getDefaultStylesheet(); if (_defaultCssStylesheet && _defaultCssStylesheet.equal(stylesheet)) return;